home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Bank smakow / BankSmakow.air / BankSmakow.swf / scripts / com / makingwaves / sql / StatementExecutor.as < prev    next >
Text File  |  2009-12-16  |  949b  |  38 lines

  1. package com.makingwaves.sql
  2. {
  3.    import flash.data.SQLConnection;
  4.    import flash.data.SQLResult;
  5.    import flash.data.SQLStatement;
  6.    import flash.utils.Dictionary;
  7.    
  8.    public class StatementExecutor
  9.    {
  10.        
  11.       
  12.       private var _connection:SQLConnection;
  13.       
  14.       public function StatementExecutor(param1:SQLConnection)
  15.       {
  16.          super();
  17.          _connection = param1;
  18.       }
  19.       
  20.       public function execute(param1:String, param2:Dictionary = null) : SQLResult
  21.       {
  22.          var _loc4_:* = null;
  23.          var _loc3_:SQLStatement = new SQLStatement();
  24.          _loc3_.sqlConnection = _connection;
  25.          _loc3_.text = param1;
  26.          if(param2 != null)
  27.          {
  28.             for(_loc4_ in param2)
  29.             {
  30.                _loc3_.parameters[_loc4_] = param2[_loc4_];
  31.             }
  32.          }
  33.          _loc3_.execute();
  34.          return _loc3_.getResult();
  35.       }
  36.    }
  37. }
  38.